package com.zerui.manager.app.accessauthorg;

import com.zerui.basedata.client.dto.OrganizationTreeDTO;
import com.zerui.cola.dto.PageResponse;
import com.zerui.cola.dto.Response;
import com.zerui.cola.dto.SingleResponse;
import com.zerui.manager.app.accessauthorg.executer.AccessAuthOrgAddCmdExe;
import com.zerui.manager.app.accessauthorg.executer.AccessAuthOrgDelCmdExe;
import com.zerui.manager.app.accessauthorg.executer.AccessAuthOrgPageCmdExe;
import com.zerui.manager.app.accessauthorg.executer.AccessAuthOrgQryTreeCmdExe;
import com.zerui.manager.web.AccessAuthOrgService;
import com.zerui.manager.web.cmd.AccessAuthOrgBindCmd;
import com.zerui.manager.web.cmd.AccessAuthOrgQryCmd;
import com.zerui.manager.web.vo.AccessAuthOrgPageVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * @Author wh
 * @create_time 2023-08-23 11:08
 */
@Service
public class AccessAuthOrgServiceImpl implements AccessAuthOrgService {

    @Resource
    private AccessAuthOrgQryTreeCmdExe accessAuthOrgQryTreeCmdExe;
    @Resource
    private AccessAuthOrgPageCmdExe accessAuthOrgQryPageCmdExe;
    @Resource
    private AccessAuthOrgAddCmdExe accessAuthOrgAddCmdExe;
	@Resource
	private AccessAuthOrgDelCmdExe accessAuthOrgDelCmdExe;

    @Override
    public SingleResponse<List<OrganizationTreeDTO>> getOrganizationTree(String orgName) {
        return accessAuthOrgQryTreeCmdExe.execute(orgName);
    }

    @Override
    public PageResponse<AccessAuthOrgPageVO> getPageList(AccessAuthOrgQryCmd accessAuthOrgQryCmd) {
        return accessAuthOrgQryPageCmdExe.execute(accessAuthOrgQryCmd);
    }

    @Override
    public Response add(AccessAuthOrgBindCmd accessAuthOrgBindCmd) {
        return accessAuthOrgAddCmdExe.execute(accessAuthOrgBindCmd);
    }

    @Override
    public Response delete(AccessAuthOrgBindCmd accessAuthOrgBindCmd) {
        return accessAuthOrgDelCmdExe.execute(accessAuthOrgBindCmd);
    }
}
